﻿using p609.datetime;

namespace test
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello, World!");

            // 获取当前时间的时间戳
            Console.Write("\n当前时间的时间戳（秒）：");
            Console.Write(Timestamp.NowTimestamp);
            Console.WriteLine("");

            DateTime dateTime = DateTime.Now;
            Console.Write("\n                  时间：");
            Console.Write(dateTime);
            Console.Write("\n  转换为时间戳（毫秒）：");
            // 时间转时间戳
            long timestamp = Timestamp.ToTimestamp(dateTime, TimestampUnits.Millisecond);
            Console.Write(timestamp);
            Console.Write("\n      时间戳转换回时间：");
            Console.Write(Timestamp.ToDataTime(timestamp));
            Console.WriteLine("");
            Console.WriteLine("");
            Console.ReadKey();

        }
    }
}
